//
//  DerbyNSOdeLog.h
//  DerbyOSSampler
//
//  Created by glenn andreas on 1/7/14.
//  Copyright (c) 2014 glenn andreas. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum {
    DerbyNSOdeLogError,
    DerbyNSOdeLogWarning,
    DerbyNSOdeLogInfo,
    DerbyNSOdeLogDebug
} DerbyNSOdeLogLevel;

#define LOG_DBG(name, fmt, ...) [[DerbyNSOdeLog logNamed: @ #name] log: DerbyNSOdeLogDebug message: fmt, ##__VA_ARGS__]
#define LOG_INFO(name, fmt, ...) [[DerbyNSOdeLog logNamed: @ #name] log: DerbyNSOdeLogDebug message: fmt, ##__VA_ARGS__]
#define LOG_ERR(name, fmt, ...) [[DerbyNSOdeLog logNamed: @ #name] log: DerbyNSOdeLogDebug message: fmt, ##__VA_ARGS__]
#define LOG_WARN(name, fmt, ...) [[DerbyNSOdeLog logNamed: @ #name] log: DerbyNSOdeLogDebug message: fmt, ##__VA_ARGS__]

@interface DerbyNSOdeLog : NSObject
+ (DerbyNSOdeLog *) logNamed: (NSString *) name;
- (void) log: (DerbyNSOdeLogLevel) level message:(NSString *)format, ...  NS_FORMAT_FUNCTION(2,3);
@property (assign) DerbyNSOdeLogLevel log;
@end
